package com.hmyd.hmyd_android.adapter;

import java.util.List;

import com.hmyd.hmyd_android.R;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class SecurityQuestionAdapter extends BaseAdapter {
	private Context mContext;
	private List<String> mDatas;

	public SecurityQuestionAdapter(Context mContext, List<String> mDatas) {
		this.mContext = mContext;
		this.mDatas = mDatas;
	}

	@Override
	public int getCount() {
		return mDatas.size();
	}

	@Override
	public Object getItem(int position) {
		return mDatas.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(mContext).inflate(
					R.layout.view_security_question_item, null);
			holder.mTextView = (TextView) convertView
					.findViewById(R.id.question);

			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		
		holder.mTextView.setText(mDatas.get(position));

		return convertView;
	}

	class ViewHolder {
		TextView mTextView;

	}

}
